//
//  OrderPhoneTableViewCell.m
//  rrqs
//
//  Created by 徐浩 on 2019/5/6.
//

#import "OrderPhoneTableViewCell.h"

@implementation OrderPhoneTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self =  [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if(self){
        
        self.contentView.backgroundColor = COLORRGB(0xededed);
        
        UIButton *gukeBtn = [[UIButton alloc]init];
        [self.contentView addSubview:gukeBtn];
        [gukeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.contentView.mas_left).offset(kSizeRatio(28));
            make.top.equalTo(self.contentView.mas_top).offset(13);
            make.bottom.equalTo(self.contentView.mas_bottom).offset(-13);
            make.size.mas_equalTo(CGSizeMake(kSizeRatio(340), 36));
        }];
        gukeBtn.backgroundColor = COLORRGB(0x50bb62);
        [gukeBtn setTitle:@"联系顾客" forState:(UIControlStateNormal)];
        [gukeBtn setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)];
        gukeBtn.titleLabel.font = kFontNameSize(12);
        [gukeBtn addTarget:self action:@selector(clickGukeBtn:) forControlEvents:(UIControlEventTouchUpInside)];
        gukeBtn.layer.cornerRadius = 4;
        gukeBtn.layer.masksToBounds = YES;
        
        UIButton *shangjiaBtn = [[UIButton alloc]init];
        [self.contentView addSubview:shangjiaBtn];
        [shangjiaBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(self.contentView.mas_right).offset(kSizeRatio(-28));
            make.top.equalTo(self.contentView.mas_top).offset(13);
            make.bottom.equalTo(self.contentView.mas_bottom).offset(-13);
            make.size.mas_equalTo(CGSizeMake(kSizeRatio(340), 36));
        }];
        shangjiaBtn.backgroundColor = COLORRGB(0x50bb62);
        [shangjiaBtn setTitle:@"联系商家" forState:(UIControlStateNormal)];
        [shangjiaBtn setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)];
        shangjiaBtn.titleLabel.font = kFontNameSize(12);
        [shangjiaBtn addTarget:self action:@selector(clickShangjiaBtn:) forControlEvents:(UIControlEventTouchUpInside)];
        shangjiaBtn.layer.cornerRadius = 4;
        shangjiaBtn.layer.masksToBounds = YES;
    }
    return self;
}

-(void)clickGukeBtn:(UIButton *)btn
{
    if (self.OrderPhoneTableViewCellDelegate && [self.OrderPhoneTableViewCellDelegate respondsToSelector:@selector(clickCustomer)]) {
        [self.OrderPhoneTableViewCellDelegate clickCustomer];
    }
}
-(void)clickShangjiaBtn:(UIButton *)btn
{
    if (self.OrderPhoneTableViewCellDelegate && [self.OrderPhoneTableViewCellDelegate respondsToSelector:@selector(clickShop)]) {
        [self.OrderPhoneTableViewCellDelegate clickShop];
    }
}


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
